3.1.29 \(\int \frac {\text {csch}(c+d x)}{a+b \tanh ^2(c+d x)} \, dx\) [29]

Optimal. Leaf size=55 \[ -\frac {\tanh ^{-1}(\cosh (c+d x))}{a d}+\frac {\sqrt {b} \tanh ^{-1}\left (\frac {\sqrt {b} \text {sech}(c+d x)}{\sqrt {a+b}}\right )}{a \sqrt {a+b} d} \]

[Out]

-arctanh(cosh(d*x+c))/a/d+arctanh(sech(d*x+c)*b^(1/2)/(a+b)^(1/2))*b^(1/2)/a/d/(a+b)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3745, 400, 213, 214} \begin {gather*} \frac {\sqrt {b} \tanh ^{-1}\left (\frac {\sqrt {b} \text {sech}(c+d x)}{\sqrt {a+b}}\right )}{a d \sqrt {a+b}}-\frac {\tanh ^{-1}(\cosh (c+d x))}{a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csch[c + d*x]/(a + b*Tanh[c + d*x]^2),x]

[Out]

-(ArcTanh[Cosh[c + d*x]]/(a*d)) + (Sqrt[b]*ArcTanh[(Sqrt[b]*Sech[c + d*x])/Sqrt[a + b]])/(a*Sqrt[a + b]*d)

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 400

Int[1/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x^n),
 x], x] - Dist[d/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0]

Rule 3745

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[(-1 + ff^2*x^2)^((m - 1)/2)*((a - b + b*ff^2*x^2)^p/x^(m
 + 1)), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \frac {\text {csch}(c+d x)}{a+b \tanh ^2(c+d x)} \, dx &=\frac {\text {Subst}\left (\int \frac {1}{\left (-1+x^2\right ) \left (a+b-b x^2\right )} \, dx,x,\text {sech}(c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\text {sech}(c+d x)\right )}{a d}+\frac {b \text {Subst}\left (\int \frac {1}{a+b-b x^2} \, dx,x,\text {sech}(c+d x)\right )}{a d}\\ &=-\frac {\tanh ^{-1}(\cosh (c+d x))}{a d}+\frac {\sqrt {b} \tanh ^{-1}\left (\frac {\sqrt {b} \text {sech}(c+d x)}{\sqrt {a+b}}\right )}{a \sqrt {a+b} d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.16, size = 123, normalized size = 2.24 \begin {gather*} \frac {i \sqrt {b} \text {ArcTan}\left (\frac {-i \sqrt {a+b}-\sqrt {a} \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {b}}\right )+i \sqrt {b} \text {ArcTan}\left (\frac {-i \sqrt {a+b}+\sqrt {a} \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {b}}\right )+\sqrt {a+b} \log \left (\tanh \left (\frac {1}{2} (c+d x)\right )\right )}{a \sqrt {a+b} d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csch[c + d*x]/(a + b*Tanh[c + d*x]^2),x]

[Out]

(I*Sqrt[b]*ArcTan[((-I)*Sqrt[a + b] - Sqrt[a]*Tanh[(c + d*x)/2])/Sqrt[b]] + I*Sqrt[b]*ArcTan[((-I)*Sqrt[a + b]
 + Sqrt[a]*Tanh[(c + d*x)/2])/Sqrt[b]] + Sqrt[a + b]*Log[Tanh[(c + d*x)/2]])/(a*Sqrt[a + b]*d)

________________________________________________________________________________________

Maple [A]
time = 2.40, size = 67, normalized size = 1.22

method result size
derivativedivides \(\frac {\frac {b \arctanh \left (\frac {2 a \left (\tanh ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 a +4 b}{4 \sqrt {a b +b^{2}}}\right )}{a \sqrt {a b +b^{2}}}+\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}}{d}\) \(67\)
default \(\frac {\frac {b \arctanh \left (\frac {2 a \left (\tanh ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 a +4 b}{4 \sqrt {a b +b^{2}}}\right )}{a \sqrt {a b +b^{2}}}+\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}}{d}\) \(67\)
risch \(\frac {\ln \left ({\mathrm e}^{d x +c}-1\right )}{d a}-\frac {\ln \left ({\mathrm e}^{d x +c}+1\right )}{d a}+\frac {\sqrt {b \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {2 \sqrt {b \left (a +b \right )}\, {\mathrm e}^{d x +c}}{a +b}+1\right )}{2 \left (a +b \right ) d a}-\frac {\sqrt {b \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 d x +2 c}-\frac {2 \sqrt {b \left (a +b \right )}\, {\mathrm e}^{d x +c}}{a +b}+1\right )}{2 \left (a +b \right ) d a}\) \(139\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csch(d*x+c)/(a+b*tanh(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(1/a*b/(a*b+b^2)^(1/2)*arctanh(1/4*(2*a*tanh(1/2*d*x+1/2*c)^2+2*a+4*b)/(a*b+b^2)^(1/2))+1/a*ln(tanh(1/2*d*
x+1/2*c)))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csch(d*x+c)/(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

-log((e^(d*x + c) + 1)*e^(-c))/(a*d) + log((e^(d*x + c) - 1)*e^(-c))/(a*d) - 2*integrate((b*e^(3*d*x + 3*c) -
b*e^(d*x + c))/(a^2 + a*b + (a^2*e^(4*c) + a*b*e^(4*c))*e^(4*d*x) + 2*(a^2*e^(2*c) - a*b*e^(2*c))*e^(2*d*x)),
x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 197 vs. \(2 (47) = 94\).
time = 0.40, size = 587, normalized size = 10.67 \begin {gather*} \left [\frac {\sqrt {\frac {b}{a + b}} \log \left (\frac {{\left (a + b\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a + b\right )} \sinh \left (d x + c\right )^{4} + 2 \, {\left (a + 3 \, b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} + a + 3 \, b\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{3} + {\left (a + 3 \, b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + 4 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{3} + 3 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{2} + {\left (a + b\right )} \sinh \left (d x + c\right )^{3} + {\left (a + b\right )} \cosh \left (d x + c\right ) + {\left (3 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} + a + b\right )} \sinh \left (d x + c\right )\right )} \sqrt {\frac {b}{a + b}} + a + b}{{\left (a + b\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a + b\right )} \sinh \left (d x + c\right )^{4} + 2 \, {\left (a - b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} + a - b\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{3} + {\left (a - b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + a + b}\right ) - 2 \, \log \left (\cosh \left (d x + c\right ) + \sinh \left (d x + c\right ) + 1\right ) + 2 \, \log \left (\cosh \left (d x + c\right ) + \sinh \left (d x + c\right ) - 1\right )}{2 \, a d}, \frac {\sqrt {-\frac {b}{a + b}} \arctan \left (\frac {{\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{3} + 3 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{2} + {\left (a + b\right )} \sinh \left (d x + c\right )^{3} + {\left (a - 3 \, b\right )} \cosh \left (d x + c\right ) + {\left (3 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} + a - 3 \, b\right )} \sinh \left (d x + c\right )\right )} \sqrt {-\frac {b}{a + b}}}{2 \, b}\right ) - \sqrt {-\frac {b}{a + b}} \arctan \left (\frac {{\left ({\left (a + b\right )} \cosh \left (d x + c\right ) + {\left (a + b\right )} \sinh \left (d x + c\right )\right )} \sqrt {-\frac {b}{a + b}}}{2 \, b}\right ) - \log \left (\cosh \left (d x + c\right ) + \sinh \left (d x + c\right ) + 1\right ) + \log \left (\cosh \left (d x + c\right ) + \sinh \left (d x + c\right ) - 1\right )}{a d}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csch(d*x+c)/(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

[1/2*(sqrt(b/(a + b))*log(((a + b)*cosh(d*x + c)^4 + 4*(a + b)*cosh(d*x + c)*sinh(d*x + c)^3 + (a + b)*sinh(d*
x + c)^4 + 2*(a + 3*b)*cosh(d*x + c)^2 + 2*(3*(a + b)*cosh(d*x + c)^2 + a + 3*b)*sinh(d*x + c)^2 + 4*((a + b)*
cosh(d*x + c)^3 + (a + 3*b)*cosh(d*x + c))*sinh(d*x + c) + 4*((a + b)*cosh(d*x + c)^3 + 3*(a + b)*cosh(d*x + c
)*sinh(d*x + c)^2 + (a + b)*sinh(d*x + c)^3 + (a + b)*cosh(d*x + c) + (3*(a + b)*cosh(d*x + c)^2 + a + b)*sinh
(d*x + c))*sqrt(b/(a + b)) + a + b)/((a + b)*cosh(d*x + c)^4 + 4*(a + b)*cosh(d*x + c)*sinh(d*x + c)^3 + (a +
b)*sinh(d*x + c)^4 + 2*(a - b)*cosh(d*x + c)^2 + 2*(3*(a + b)*cosh(d*x + c)^2 + a - b)*sinh(d*x + c)^2 + 4*((a
 + b)*cosh(d*x + c)^3 + (a - b)*cosh(d*x + c))*sinh(d*x + c) + a + b)) - 2*log(cosh(d*x + c) + sinh(d*x + c) +
 1) + 2*log(cosh(d*x + c) + sinh(d*x + c) - 1))/(a*d), (sqrt(-b/(a + b))*arctan(1/2*((a + b)*cosh(d*x + c)^3 +
 3*(a + b)*cosh(d*x + c)*sinh(d*x + c)^2 + (a + b)*sinh(d*x + c)^3 + (a - 3*b)*cosh(d*x + c) + (3*(a + b)*cosh
(d*x + c)^2 + a - 3*b)*sinh(d*x + c))*sqrt(-b/(a + b))/b) - sqrt(-b/(a + b))*arctan(1/2*((a + b)*cosh(d*x + c)
 + (a + b)*sinh(d*x + c))*sqrt(-b/(a + b))/b) - log(cosh(d*x + c) + sinh(d*x + c) + 1) + log(cosh(d*x + c) + s
inh(d*x + c) - 1))/(a*d)]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\operatorname {csch}{\left (c + d x \right )}}{a + b \tanh ^{2}{\left (c + d x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csch(d*x+c)/(a+b*tanh(d*x+c)**2),x)

[Out]

Integral(csch(c + d*x)/(a + b*tanh(c + d*x)**2), x)

________________________________________________________________________________________

Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csch(d*x+c)/(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,sageVARx):;OUTP
UT:Warning, need to choose a branch for the root of a polynomial with parameters. This might be wrong.The choi
ce was done

________________________________________________________________________________________

Mupad [B]
time = 1.92, size = 284, normalized size = 5.16 \begin {gather*} -\frac {2\,\mathrm {atan}\left (\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\left (9\,b^4\,\sqrt {-a^2\,d^2}+16\,a^2\,b^2\,\sqrt {-a^2\,d^2}+24\,a\,b^3\,\sqrt {-a^2\,d^2}\right )}{16\,d\,a^3\,b^2+24\,d\,a^2\,b^3+9\,d\,a\,b^4}\right )}{\sqrt {-a^2\,d^2}}-\frac {\sqrt {b}\,\left (2\,\mathrm {atan}\left (\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}\,\sqrt {-a^2\,d^2\,\left (a+b\right )}+{\mathrm {e}}^{3\,c}\,{\mathrm {e}}^{3\,d\,x}\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}\,\sqrt {-a^2\,d^2\,\left (a+b\right )}+4\,a^2\,b\,d^2\,{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c}{2\,a\,\sqrt {b}\,d\,\sqrt {-a^2\,d^2\,\left (a+b\right )}}\right )-2\,\mathrm {atan}\left (\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\sqrt {-a^2\,d^2\,\left (a+b\right )}}{2\,a\,\sqrt {b}\,d}\right )\right )}{2\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sinh(c + d*x)*(a + b*tanh(c + d*x)^2)),x)

[Out]

- (2*atan((exp(d*x)*exp(c)*(9*b^4*(-a^2*d^2)^(1/2) + 16*a^2*b^2*(-a^2*d^2)^(1/2) + 24*a*b^3*(-a^2*d^2)^(1/2)))
/(24*a^2*b^3*d + 16*a^3*b^2*d + 9*a*b^4*d)))/(-a^2*d^2)^(1/2) - (b^(1/2)*(2*atan((exp(d*x)*exp(c)*(- a^3*d^2 -
 a^2*b*d^2)^(1/2)*(-a^2*d^2*(a + b))^(1/2) + exp(3*c)*exp(3*d*x)*(- a^3*d^2 - a^2*b*d^2)^(1/2)*(-a^2*d^2*(a +
b))^(1/2) + 4*a^2*b*d^2*exp(d*x)*exp(c))/(2*a*b^(1/2)*d*(-a^2*d^2*(a + b))^(1/2))) - 2*atan((exp(d*x)*exp(c)*(
-a^2*d^2*(a + b))^(1/2))/(2*a*b^(1/2)*d))))/(2*(- a^3*d^2 - a^2*b*d^2)^(1/2))

________________________________________________________________________________________